<template>
	<view class="container">
		<view class="balance-section">
			<text class="balance-label">账户余额</text>
			<text class="balance-amount">￥1500.00</text>
		</view>

		<view class="withdrawal-section">
			<view class="input-item">
				<text class="input-label">提现金额</text>
				<input type="number" placeholder="请输入提现金额" class="input-value" style="margin-left: 106rpx;"
					v-model="withdrawalAmount" />
				<text class="input-unit">元</text>
			</view>

			<view class="input-item">
				<text class="input-label">真实姓名</text>
				<input type="text" placeholder="请输入真实姓名" class="input-value" style="margin-left: 106rpx;"
					v-model="realName" />
			</view>

			<view class="input-item">
				<text class="input-label">请选择银行</text>
				<picker mode="selector" :range="banks" @change="onBankChange" class="input-value">
					<view class="picker-placeholder">请选择银行 <image src="/static/下拉框下拉 .png"></image>
					</view>
				</picker>
			</view>

			<view class="input-item">
				<text class="input-label">请输入银行卡卡号</text>
				<input type="text" placeholder="请输入银行卡卡号" class="input-value" style="margin-left: 0;"
					v-model="bankCard" />
			</view>

			<text class="privacy-tip">xxx不会通过任何渠道泄露您的个人信息，请放心填写</text>

			<button class="submit-button" @click="submitWithdrawal">确认信息并提交</button>
		</view>



		<view class="record-section">
			<view class="record-title">提现记录</view>
			<view class="record-item" v-for="(record, index) in withdrawalRecords" :key="index">
				<view class="record-label">
					<view>
						{{ record.label }}
					</view>
					<view class="record-time">{{ record.time }}</view>
				</view>
				<view class="record-amount">
					<view style="font-weight: 550;">

						{{ record.amount }}
					</view>

					<view class="record-status" :style="{ color: record.statusColor }">{{ record.status }}</view>
				</view>


			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue";

	const withdrawalAmount = ref("");
	const realName = ref("");
	const selectedBank = ref("");
	const bankCard = ref("");

	const banks = ref(["中国银行", "工商银行", "建设银行", "农业银行", "交通银行"]);

	const onBankChange = (e) => {
		selectedBank.value = banks.value[e.detail.value];
	};

	const submitWithdrawal = () => {
		// uni.showToast({
		// 	title: "提现申请已提交",
		// 	icon: "success",
		// });
		uni.navigateTo({
			url: "/pages/index/incomeDetails/cash/success/success",
		});
	};

	const withdrawalRecords = ref([{
			label: "商家提现申请",
			amount: "-1.00",
			time: "2020-02-13 09:32:12",
			status: "审核中",
			statusColor: "#333",
		},
		{
			label: "商家提现申请",
			amount: "-1.00",
			time: "2020-02-13 09:32:12",
			status: "审核通过",
			statusColor: "#00ff00",
		},
		{
			label: "商家提现申请",
			amount: "-1.00",
			time: "2020-02-13 09:32:12",
			status: "审核不通过",
			statusColor: "#ff0000",
		},
	]);
</script>

<style scoped>
	.container {
		padding: 20rpx;
		background-color: white;
	}

	.balance-section {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #ffffff;
		padding: 20rpx;
		margin-bottom: 20rpx;
	}

	.balance-label {
		font-size: 32rpx;
		color: black;

	}

	.balance-amount {
		font-size: 48rpx;
		font-weight: bold;
		color: #ff0000;
	}

	.balance-section {
		font-weight: 550;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #ffffff;
		padding: 20rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 4rpx 2rpx rgba(0, 0, 0, 0.1);

	}

	.balance-label {
		font-size: 32rpx;
		color: #333333;

	}

	.balance-amount {
		font-size: 48rpx;
		font-weight: bold;
		color: #ff0000;
	}

	.withdrawal-section {
		background-color: #ffffff;
		padding: 20rpx;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
	}

	.input-item {
		display: flex;
		align-items: center;

		margin-bottom: 20rpx;
		padding-bottom: 10rpx;
		box-shadow: 0 4rpx 2rpx rgba(0, 0, 0, 0.1);


	}

	.input-label {
		font-size: 28rpx;
		color: #333333;
		font-weight: 550;
		margin-right: 60rpx;
	}

	.input-value {
		font-size: 28rpx;
		color: #666666;
		border: 1rpx solid #cccccc;
		padding: 14rpx;
		border-radius: 10rpx;
		width: 300rpx;
		margin-left: 80rpx;
	}


	.picker-placeholder {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}


	.picker-placeholder text {
		font-size: 28rpx;
		color: #666666;
	}

	.picker-placeholder image {
		width: 30rpx;
		height: 30rpx;
		margin-right: 10rpx;
	}

	.input-unit {
		font-size: 28rpx;
		color: #333333;
		margin-left: 10rpx;
	}

	.privacy-tip {
		font-size: 24rpx;
		color: #999999;
		margin-bottom: 20rpx;
	}

	.submit-button {
		width: 400rpx;
		height: 80rpx;
		background-color: #007aff;
		color: #ffffff;
		font-size: 32rpx;
		border: none;
		outline: none;
		border-radius: 20rpx;
		margin-top: 20rpx;
	}

	.record-section {
		background-color: #ffffff;
		padding: 20rpx;
	}

	.record-title {
		font-size: 34rpx;
		font-weight: bold;
		color: #333333;
		margin-bottom: 30rpx;
	}

	.record-item {
		display: flex;
		justify-content: space-between;
		margin-bottom: 20rpx;
		padding: 0 10rpx;
	}

	.record-label {
		font-size: 28rpx;
		color: black;
		font-weight: 700;
	}

	.record-amount {
		font-size: 28rpx;
		color: #ff0000;
		font-weight: 550;
	}

	.record-time {
		font-size: 24rpx;
		color: #333;
		font-weight: 550;
	}

	.record-status {
		font-size: 24rpx;
		font-weight: 550;
	}
</style>